<template>
  <div class="sliderCom-wrapper">
    <div class="slider-cont">
      <el-slider
        @change="changeHandler"
        @input="inputHandler"
        v-model="value"
        :step="1"
      >
      </el-slider>
    </div>
  </div>
</template>

<script>
export default {
  name: "sliderCom",
  components: {},
  inject: ["getBgImgOptions"],
  props: {
    sliderType: {
      type: String,
      default: "1",
    },
  },
  data() {
    return {
      value: 0, //当前值
    };
  },
  computed: {
    sType() {
      return this.sliderType;
    },
  },
  created() {},
  mounted() {},
  methods: {
    changeHandler(val) {
      console.log(val, "changeHandler");
    //   this.getBgImgOptions({
    //     type: this.sliderType,
    //     value: val,
    //   });
    },
    inputHandler(val) {
      console.log(val, "inputHandler");
      this.getBgImgOptions({
        type: this.sliderType,
        value: val,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.sliderCom-wrapper,
.slider-cont {
  width: 100%;
  height: 100%;
  margin: 0;
}
.slider-cont {
  box-sizing: border-box;
  padding: 0 11px;
}
</style>
